
import Vue from "vue";
import Vuex from "vuex";
import App from "./app.vue";
import createLogger from "./logger/logger.js"
/*elm*/
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-default/index.css';

Vue.use(Vuex);
Vue.use(ElementUI);



const store = new Vuex.Store({   
     state : {
         data : {
            filterBox:[],
         } 
     },
     mutations : {
       ADDFILTER(state , payload){
            //console.log(payload);
            state.data.filterBox.push(payload);
          

       },
       HANDLECLOSE(state , payload){
            //console.log(payload);
            //console.log(state.data.filterBox.indexOf(payload))
            state.data.filterBox.splice(state.data.filterBox.indexOf(payload) , 1);
       }
     },
     getters : {
        getFilter(state){
            return state.data.filterBox;
        },
     },
     strict: process.env.NODE_ENV !== 'production',
     plugins: [createLogger()]

});

new Vue({
     el : "#root",
     store,                    
     components : {
         App 
     }
})
